<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
{{assign var="title" value='用户'}}
{{assign var="app" value='user'}}
{{assign var="act" value='index'}}
{{assign var="table" value='user'}}
{{assign var="td" value='10'}}
<title>{{$title}}管理 - {{'admin|admin_site_name'|C|default:'后台管理'}}</title>
{{include file="include/base.html"}}
{{include file="{{$smarty.const.PLUG}}chosen/chosen.html"}}
{{include file="{{$smarty.const.PLUG}}tip/tip.html"}}
</head>
<body>

{{include file="include/sidebar.html"}}

<div class="body_right">
	<div id="content">

	<div class="search">
	<form action="index.php?app={{$app}}" method="get" name="search" class="router">
		<input type="hidden" name="app" value="{{$app}}"/>
		<ul class="bread">
			<li>
				用户名：<input class="input-small" type="text" name="username" value="{{$smarty.get.username}}" />
			</li>
			<li>
				角色：
				<select name="role_id">
					<option value="">请选择...</option>
					{{html_options options=$roles selected=$smarty.get.role_id}}
				</select>
			</li>
			<li>
				<button type="submit" class="search btn btn-success"><i class="icon-search"></i>搜索</button>
				<a href="index.php?app={{$app}}" class="a">清除</a>
			</li>
		</ul>
	</form>
	</div>

	<form action="index.php?app={{$app}}" method="post" name="form">
	<input type="hidden" name="app" value="{{$app}}"/>
	<input type="hidden" name="act" value="{{$act}}"/>
	<table class="table table-bordered">
		<tr class="thead">
		  <td colspan="{{$td}}">
		  <div class="floatr">
			<a class="btn iframe" href="index.php?app={{$app}}&act=modify&iframe=true" height="450" width="800"><i class="icon-plus"></i>添加{{$title}}</a>
			<a class="btn mydelete btn-danger" href="javascript:"><i class="icon-trash icon-white"></i>批量删除</a>
		  </div>
		  ◆ {{$title}}管理 －> {{$title}}列表
		  </td>
		</tr>
		
		{{if !$result}}
		<tr class="noline"><td colspan="{{$td}}" class="result_empty"></td></tr>
		{{else}}
		<tr class="ttitle">
			<th width="30px"><label><input class="check_all" type="checkbox"/></label></th>
			<th>ID</th>
			<th>用户名</th>
			<th>Email</th>
			<th>角色</th>
			<th>登录信息</th>
			<th>状态</th>
			<th>登录数</th>
			<th width="70px">操作</th>
		</tr>
		<tbody>
			{{foreach item=val from=$result}}
			<tr>
				<td><label><input name="check_id[]" class="check_id" value="{{$val.id}}" type="checkbox"/></label></td>
				<td>{{$val.id}}<input type="hidden" name="ids[]" value="{{$val.id}}" /></td>
				<td><a href="index.php?app={{$app}}&act=detail&id={{$val.id}}&iframe=true" class="a iframe">{{$val.username}}</a></td>
				<td>{{$val.email}}</td>
				<td>{{$val.role_id}}</td>
				<td>
					<a height='490' href='index.php?app={{$app}}&act=online&id={{$val.id}}&iframe=true' class='tip btn iframe' title="　　在线时长 : {{$val.online}}小时 <br> 　最近登录 IP : {{$val.login_ip}} <br> 最近登录时间 : {{$val.login_time}} <br> 最近访问时间 : {{$val.loginout_time}} <br> 　　注册时间 : {{$val.register_time}}">
					<i class="icon-comment"></i>
					</a>
				</td>
				{{*状态*}}<td>{{if $val.id!=1}}<a class="ajaxSubmit refresh" link="index.php?app=functions&act=setValue&value={{!$val.publish}}&params={{'table='|cat:$table|cat:'&field=publish&id='|cat:$val.id|encode}}"><span class="select_{{$val.publish}}"></span></a>{{else}}/{{/if}}</td>
				<td>{{$val.hit}}</td>
				<td>
					<a href="index.php?app=user&act=modify&id={{$val.id}}&iframe=true" class="btn iframe" height="450" width="800" title="编辑"><i class="icon-edit"></i>编辑</a>
				</td>
			</tr>
		    {{/foreach}}
			<tr class="noline ttitle">
			  <td colspan="{{$td}}">
				<a class="check_all btn"><i class="icon-ok"></i>全选/反选</a>
			  </td>
			</tr>
			{{/if}}
			<tr class="thead">
			  <td colspan="{{$td}}">
				{{include file="include/page.html"}}
			  </td>
			</tr>
		</tbody>
	</table>
	</form>
	
</div>
</div>

</body>
</html>